#use "test03_parser.ml";;

let p = create ();;

let p = post 1 'X' p;;
let p = post 2 'Y' p;;
let p = post 3 '\x1a' p;; (* eof *)

flush stderr;;

if accepted p then (
	begin match result p with
	| Some (Some C, Some Y) ->
		begin match errors p with
		| [1, Unexpected 'X'] ->
			print_string "OK.\n";
		| _ ->
			raise (Failure "BAD ERRORS DETECTED!!")
		end
	| _ ->
		raise (Failure "BAD RESULT!!")
	end
) else (
	raise (Failure "NOT ACCEPTED!!")
);;
